#include <iostream>
#include <string>
#include <vector>
using namespace std;
int StrFind(int first, int last, const string& val, vector<string>& v)
{
    while (first != last)
    {
        if (v[first].compare(val) == 0)
            return first;
        ++first;
    }
    return last;
}
int main() {
    int n;
    cin >> n;
    vector<string> v(n);
    for (int i = 0; i < n; i++)
    {
        cin >> v[i];
    }
    int ans = 0;
    vector<int> Count(n, 0);

    for (int i = 0; i < n; i++)
    {
        int t = StrFind(0, i, v[i], v);
        if (t != i)
        {
            Count[t]++;
        }
        else
        {
            Count[t] = 1;
        }
        if (Count[t] <= ans + 1 && Count[t] == ans + 1)
        {
            ans++;
            Count[t] = -10000;
        }
    }
    cout << ans;
}
